// miniprogram/pages/bookingDetail/bookingDetail.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        loading:false,
        bookingDetailData:[],
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        //options:参数对象
        //截取_ids
         let _ids = options._ids

         this.getBookingDataByIds(_ids);
    },

    //根据多个_id获取记账数据
    getBookingDataByIds(_ids){
        wx.showLoading({
          title: '加载中....',
          mask:true
        })

        wx.cloud.callFunction({
            name:'get_booking_byids',
            data:{
                _id:_ids
            }
        }).then( res =>{
            wx.hideLoading()

            this.setData({
                bookingDetailData:res.result.data
            })

            wx.setNavigationBarTitle({
                title:`${res.result.data[0].mainType.title}-${res.result.data[0].subType.title}记账详情`
            })
            
        }).catch(err=>{
            
        })
    }

})